package com.foxmail.aroundme.youtubedemo.baseYouTube;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.foxmail.aroundme.youtubedemo.R;
import com.foxmail.aroundme.youtubedemo.recyclerview.DividerItemDecoration;
import com.foxmail.aroundme.youtubedemo.recyclerview.RecyclerViewAdapter;
import com.foxmail.aroundme.youtubedemo.recyclerview.RecyclerViewAty;
import com.foxmail.aroundme.youtubedemo.utils.RandomId;
import com.google.android.youtube.player.YouTubeBaseActivity;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * Created by gzl on 2016/10/27.
 */

public class BaseYouTube extends YouTubeBaseActivity{

    List<String> list = new ArrayList<String>();
    RecyclerViewAdapter adapter;
    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.base_youtube);
        Random random = new Random();
        for(int i = 0 ; i < 100; i ++){
            list.add(RandomId.args[random.nextInt(100)]);
        }
        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.base_recy);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.addItemDecoration(new DividerItemDecoration(this,
                DividerItemDecoration.VERTICAL_LIST));
        adapter = new RecyclerViewAdapter(BaseYouTube.this, list, getFragmentManager());
        recyclerView.setAdapter(adapter);
    }
}
